package com.sakura.service.impl;/**
 * Created by apple on 2019/3/25.
 */

import com.sakura.service.PropertiesService;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.Properties;

/**
 * @author jixd
 * @Description TODO
 * @Date 2019/3/25 1:44 PM
 * @Version 1.0
 **/
@Component
public class PropertiesServiceImpl implements PropertiesService{
    @Override
    public void getPropertiesByThread() {
        Properties properties = new Properties();
        try {
            properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("application.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println(properties.getProperty("root"));
    }
}
